Aim: To implement CRUD operation in mongo db
Software: MongoDB Server, Command line, Mongo shell service


++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
🔹 STEP 1: Create Database
use BDA

✔️ Output:

switched to db BDA
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
🔹 STEP 2: CREATE Operations
✅ Insert One Document
db.student.insertOne({
  name: "Sumit",
  age: 20,
  course: "BSc IT"
})


✅ Insert Many Documents
db.student.insertMany([
  {name: "Rahul", age: 21, course: "BSc IT"},
  {name: "Neha", age: 22, course: "BSc CS"},
  {name: "Amit", age: 23, course: "BCA"}
])
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
🔹 STEP 3: READ Operations
✅ Display All Data
db.student.find().pretty()


✅ Find Specific Data
db.student.find({name: "Sumit"}).pretty()

+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
🔹 STEP 4: UPDATE Operations
✅ Update One Document
db.student.updateOne(
  {name: "Sumit"},
  {$set: {age: 25}}
)


✅ Update Multiple Documents
db.student.updateMany(
  {},
  {$set: {year: "TY"}}
)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
🔹 STEP 5: READ AGAIN (Important for Output)
db.student.find().pretty()

👉 Shows updated values
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
🔹 STEP 6: DELETE Operations
✅ Delete One Document
db.student.deleteOne({name: "Amit"})


✅ Delete Multiple Documents
db.student.deleteMany({})
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
🔹 STEP 7: FINAL CHECK
db.student.find().pretty()

👉 Output: Empty (collection cleared)